package com.apestech.framework.dictionary.modul;

import com.apestech.framework.json.JSONObject;

/**
 * @author hup
 * @create 2018-08-24-11:03
 */
public class PrimaryKey {

    private String pkName;
    private String pkColumn;
    private String tableName;

    public PrimaryKey(){ }

    public PrimaryKey(JSONObject map){
        if(map==null) return;
        pkName=map.getString("pkName");
        pkColumn=map.getString("pkColumn");
        tableName=map.getString("tableName");
    }

    public String getPkName() {
        return pkName;
    }

    public void setPkName(String pkName) {
        this.pkName = pkName;
    }

    public String getPkColumn() {
        return pkColumn;
    }

    public void setPkColumn(String pkColumn) {
        this.pkColumn = pkColumn;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public int size(){
        if(pkName==null && pkColumn==null && tableName==null){
            return 0;
        } else {
            return 1;
        }
    }

}
